﻿using Microsoft.Practices.Prism.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace WebServerConnectorDll
{
    [DataContract]
    public class CDeviceTime : NotificationObject, IFruitClass
    {
        private int uid;
        private int deviceUID;
        private String time;

        [DataMember(Order = 0)]
        public int UID
        {
            get
            {
                return uid;
            }
            set
            {
                uid = value;
                RaisePropertyChanged("UID");
            }
        }

        [DataMember(Order = 1)]
        public int DeviceUID
        {
            get
            {
                return deviceUID;
            }
            set
            {
                deviceUID = value;
                RaisePropertyChanged("DeviceUID");
            }
        }

        [DataMember(Order = 2)]
        public String Time
        {
            get
            {
                return time;
            }
            set
            {
                time = value;
                RaisePropertyChanged("Time");
            }
        }

        public CDeviceTime(int pDeviceUID, String pTime)
        {
            DeviceUID = pDeviceUID;
            Time = pTime;
        }

        public String ToInsertString()
        {
            return "\'" + DeviceUID + "\'-\'" + Time + "\'";
        }

        public String ToUpdateString()
        {
            return "DeviceUID=\'" + DeviceUID + "\',Time=\'" + Time + "\'";
        }
    }
}

